import request from '../utils/request';
import { PRE_DATA, COMMON_DATA, USER_DATA, USER_EXPORT, ODER_DATA, COMMON_DATA_LIST, TIME_DATA,EXPORT_DATA} from '../utils/api'
/**
 * [getPreData 预览数据]
 * @param  {String} [startDate="" }] [公司id]
 * @param  {String} [endDate="" }] [页码]
 */
export async function getPreData({ startDate, endDate}) {
  return request(PRE_DATA , {
    method: 'POST',
    body: {
      startDate, endDate
    },
  })
}

/**
 * [getCommonList 通用数据]
 */
export async function getCommonList({ startDate, endDate}) {
  return request(COMMON_DATA  , {
    method: 'POST',
    body: {
      // startDate, endDate
    },
  })
}

/**
 * [getUserData 获取用户数据]
 * @param  {String} [startDate=""] [开始日期]
 * @param  {String} [endDate=""] [结束日期]
 * @param  {String} [currentOsType=""] [平台类型]
 * @param  {String} [countryId=""] [国家ID]
 * @param  {String} [page = ""] [页码]
 * @param  {String} [pageSize=10] [每页条数]
 * 
 */
export async function getUserData({ startDate, endDate, currentOsType, countryId, page, pageSize}) {
  return request(USER_DATA  , {
    method: 'POST',
    body: {
      startDate, endDate, currentOsType, countryId, page, pageSize
    },
  })
}

/**
 * [getExportUser 导出用户数据]
 * @param  {String} [startDate=""] [开始日期]
 * @param  {String} [endDate=""] [结束日期]
 * @param  {String} [currentOsType=""] [平台类型]
 * @param  {String} [countryId=""] [国家ID]
 * 
 * 
 */
export async function getExportUser({ startDate, endDate, currentOsType, countryId}) {
  return request(USER_EXPORT  , {
    method: 'POST',
    body: {
      startDate, endDate, currentOsType, countryId
    },
  })
}

/**
 * [getOderData 获取订单数据]
 * @param  {String} [startDate=""] [开始日期]
 * @param  {String} [endDate=""] [结束日期]
 * @param  {String} [platform=""] [平台类型]
 * @param  {String} [countryId=""] [国家ID]
 * @param  {String} [page = ""] [页码]
 * @param  {String} [pageSize=10] [每页条数]
 * 
 * 
 */
export async function getOderData({ startDate, endDate, platform, countryId, page, pageSize}) {
  return request(ODER_DATA, {
    method: 'POST',
    body: {
      startDate, endDate, platform, countryId, page, pageSize
    },
  })
}


/**
 * [getCommonDataList 获取公共数据]
 * 
 * 
 */
export async function getCommonDataList({}) {
  return request(COMMON_DATA_LIST, {
    method: 'POST',
    body: {
      
    },
  })
}

/**
 * [getTimeData 获取物流时效统计数据]
 * @param  {String} [customerNo=""] [客户号]
 * @param  {String} [expressNo=""] [订单号]
 * @param  {String} [orderState=""] [订单状态]
 * @param  {String} [logisticsState=""] [物流状态]
 * @param  {String} [destId = ""] [目的港]
 * @param  {String} [timeSlot = ""] [时间段]
 * @param  {String} [startDate=""] [开始时间]
 * @param  {String} [endDate=""] [结束时间]
 * @param  {String} [page=""] [页码]
 * @param  {String} [pageSize="10"] [每条显示数]
 * 
 * 
 * 
 */
export async function getTimeData({ customerNo, expressNo,destId, orderState, logisticsState, timeSlot, startDate,endDate,page,pageSize}) {
  return request(TIME_DATA, {
    method: 'POST',
    body: {
      customerNo, expressNo, orderState, destId, logisticsState, timeSlot, startDate,endDate,page,pageSize
    },
  })
}

/**
 * [exportData 获取公共数据]
* @param  {String} [customerNo=""] [客户号]
 * @param  {String} [expressNo=""] [订单号]
 * @param  {String} [orderState=""] [订单状态]
 * @param  {String} [logisticsState=""] [物流状态]
 * @param  {String} [destId = ""] [目的港]
 * @param  {String} [timeSlot = ""] [时间段]
 * @param  {String} [startDate=""] [开始时间]
 * @param  {String} [endDate=""] [结束时间]
 * @param  {String} [page=""] [页码]
 * @param  {String} [pageSize="10"] [每条显示数]
 */
export async function exportData({customerNo, expressNo, orderState, destId, logisticsState, timeSlot, startDate,endDate,page,pageSize}) {
  return request(EXPORT_DATA, {
    method: 'POST',
    body: {
      customerNo, expressNo, orderState, destId, logisticsState, timeSlot, startDate,endDate,page,pageSize
    },
  })
}